Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
class BanChatMemberAction(userId: Long, untilDate: Instant? = null, revokeMessages: Boolean? = null) : Action<Boolean>
Link copied to clipboard
class BanChatSenderChatAction(senderChatId: Long) : Action<Boolean>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class PinChatMessageAction(messageId: Long, disableNotification: Boolean? = null) : Action<Boolean>
Link copied to clipboard
class RestrictChatMemberAction(userId: Long, permissions: ChatPermissions, untilDate: Instant? = null, useIndependentChatPermissions: Boolean? = null) : Action<Boolean>
Link copied to clipboard
Link copied to clipboard
class SendChatAction(action: ChatAction, messageThreadId: Int? = null) : Action<Boolean> , BusinessActionExt<Boolean>
Link copied to clipboard
class SetChatDescriptionAction(description: String? = null) : Action<Boolean>
Link copied to clipboard
Link copied to clipboard
class SetChatPermissionsAction(permissions: ChatPermissions, useIndependentChatPermissions: Boolean? = null) : Action<Boolean>
Link copied to clipboard
Link copied to clipboard
class SetChatStickerSetAction(stickerSetName: String) : Action<Boolean>
Link copied to clipboard
Link copied to clipboard
class UnbanChatMemberAction(userId: Long, onlyIfBanned: Boolean? = null) : Action<Boolean>
Link copied to clipboard
class UnbanChatSenderChatAction(senderChatId: Long) : Action<Boolean>
Link copied to clipboard

Functions

Link copied to clipboard

Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.

Link copied to clipboard
inline fun banChatMember(user: User, untilDate: Instant? = null, revokeMessages: Boolean? = null): BanChatMemberAction

inline fun banChatMember(userId: Long, untilDate: Instant? = null, revokeMessages: Boolean? = null): BanChatMemberAction

Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

Link copied to clipboard

Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.

Link copied to clipboard
inline fun chatAction(action: ChatAction, messageThreadId: Int? = null): SendChatAction

Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success. We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.

inline fun chatAction(messageThreadId: Int? = null, block: () -> ChatAction): SendChatAction
Link copied to clipboard

Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as ChatInviteLink object.

Link copied to clipboard

Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.

Link copied to clipboard

Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

Link copied to clipboard

Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.

Link copied to clipboard

Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a ChatInviteLink object.

Link copied to clipboard

Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.

Link copied to clipboard
inline fun getChat(): GetChatAction

Use this method to get up to date information about the chat. Returns a Chat object on success.

Link copied to clipboard

Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects.

Link copied to clipboard

Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a ChatMember object on success.

Link copied to clipboard

Use this method to get the number of members in a chat. Returns Int on success.

Link copied to clipboard

Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.

Link copied to clipboard

Use this method for your bot to leave a group, supergroup or channel. Returns True on success.

Link copied to clipboard
inline fun pinChatMessage(messageId: Long, disableNotification: Boolean? = null): PinChatMessageAction

Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.

Link copied to clipboard

Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success.

Link copied to clipboard
inline fun restrictChatMember(user: User, chatPermissions: ChatPermissions, untilDate: Instant? = null, useIndependentChatPermissions: Boolean? = null): RestrictChatMemberAction
inline fun restrictChatMember(user: User, untilDate: Instant? = null, useIndependentChatPermissions: Boolean? = null, chatPermissions: ChatPermissions.() -> Unit): RestrictChatMemberAction
inline fun restrictChatMember(userId: Long, chatPermissions: ChatPermissions, untilDate: Instant? = null, useIndependentChatPermissions: Boolean? = null): RestrictChatMemberAction

inline fun restrictChatMember(userId: Long, untilDate: Instant? = null, useIndependentChatPermissions: Boolean? = null, chatPermissions: ChatPermissions.() -> Unit): RestrictChatMemberAction

Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.

Link copied to clipboard

Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object.

Link copied to clipboard
inline fun sendChatAction(action: ChatAction, messageThreadId: Int? = null): SendChatAction
inline fun sendChatAction(messageThreadId: Int? = null, block: () -> ChatAction): SendChatAction
Link copied to clipboard

Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.

Link copied to clipboard

Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

Link copied to clipboard

Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.

Link copied to clipboard
inline fun setChatPermissions(permissions: ChatPermissions, useIndependentChatPermissions: Boolean? = null): SetChatPermissionsAction

Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.

inline fun setChatPermissions(useIndependentChatPermissions: Boolean? = null, permissions: ChatPermissions.() -> Unit): SetChatPermissionsAction
Link copied to clipboard

Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

inline fun setChatPhoto(block: () -> String): SetChatPhotoAction
Link copied to clipboard
inline fun setChatStickerSet(stickerSetName: String): SetChatStickerSetAction

Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.

Link copied to clipboard

Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

Link copied to clipboard
inline fun unbanChatMember(user: User, onlyIfBanned: Boolean? = null): UnbanChatMemberAction

inline fun unbanChatMember(userId: Long, onlyIfBanned: Boolean? = null): UnbanChatMemberAction

Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success.

Link copied to clipboard

Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success.

Link copied to clipboard

Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.

Link copied to clipboard

Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.